package com.yoyo.schedule.task_manager;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class HeartBeatTimerTask extends java.util.TimerTask {
    //private static transient Logger log = LoggerFactory.getLogger(HeartBeatTimerTask.class);
    private AbstractScheduleManager abstractScheduleManager;

    public HeartBeatTimerTask(AbstractScheduleManager abstractScheduleManager) {
        this.abstractScheduleManager = abstractScheduleManager;
    }

    public void run() {
        try {
            Thread.currentThread().setPriority(Thread.MAX_PRIORITY);
            abstractScheduleManager.refreshScheduleServerInfo();
        } catch (Exception ex) {
            log.error(ex.getMessage(), ex);
        }
    }
}
